﻿@model IEnumerable<CID.Domain.Operations.Environment>

@{
    ViewBag.Title = "Environments' Index";
}

<h2>Environments</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Name
        </th>
        <th>
            Description
        </th>
        <th>
            Enabled
        </th>
        <th>
            IsProduction
        </th>
        <th>
            Responsible
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Enabled)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.IsProduction)
        </td>
        <td>
            @if (item.Responsible != null)
            {
                @Html.DisplayFor(modelItem => item.Responsible.Name)
            }
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
